<?php
namespace Admin\Model;
use Think\Model;
class IndexModel extends Model{
function getCode(){
		//指定条件 fid=$fid
		$arr=$this->select();
		$optionStr="";
		foreach($arr as $v){
			if($v['id']==$selectId){
				$optionStr.="<option selected='selected' value='{$v['id']}'>{$v['name']}</option>";
			}else{
				$optionStr.="<option value='{$v['id']}'>{$v['name']}</option>";
			}
			//找第一级的子分类
			$optionSon=$this->getType($v['id']);
			$optionStr.=$optionSon;
		}
		//返回数据 <option value='id'>名称</option>
		return $optionStr;
	}
}